package com.glamour.hlcity.component.task.common;

import java.lang.annotation.Annotation;

import com.glamour.hlcity.common.annotation.ExecuteTarget;

public class BeanUtil {
	
	public static  <T> T   getBeanWithExecuteTarget(T obj,String beanName){
		Annotation[] annotations= obj.getClass().getAnnotations();
		ExecuteTarget annotation=(ExecuteTarget) obj.getClass().getAnnotation(ExecuteTarget.class);
		if(annotation==null){
			return null;
		}
		if(beanName.equals(annotation.executeBeanName())){
			return obj;
		}
		return null;
	}

}
